package com.my.study.design.rule.support;

import com.my.study.design.rule.IRule;
import com.my.study.design.rule.RuleExecuteResult;

/**
 * 数据处理抽象类
 *
 * @author: yidujun
 * @create: 2021/07/09 21:43
 */
public abstract class AbstractOperateRule implements IRule {

    @Override
    public RuleExecuteResult execute(Object obj) {
        Object newObj = operate(obj);
        return new RuleExecuteResult(RuleExecuteResult.EnumRuleResult.CONTINUE, newObj);
    }

    /**
     * 数据处理
     *
     * @param obj
     * @return
     */
    protected abstract Object operate(Object obj);
}
